home *** CD-ROM | disk | FTP | other *** search
- Path: ipg.umds.ac.uk!newsadm
- From: "A.Bhalerao" <a.bhalerao@umds.ac.uk>
- Newsgroups: comp.lang.c++
- Subject: Re: Template Class Linkage?
- Date: 9 Jan 1996 13:55:21 GMT
- Organization: United Medical & Dental Schools, Guy's & St.Thomas' Hosp. London
- Message-ID: <4cts49@news-ipg.umds.ac.uk>
- References: <4cmnjs$mk7@mimsy.cs.umd.edu> <4cq4hs$raa@news2.deltanet.com> <4crpps$7ni@mimsy.cs.umd.edu> <1996Jan9.004515.8691@ohstpy>
- NNTP-Posting-Host: mimi.umds.ac.uk
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.1N (X11; I; HP-UX A.09.01 9000/735)
- X-URL: news:1996Jan9.004515.8691@ohstpy
-
- You don't have to include the template methods in the header files
- if the compiler uses some non-standard way of keeping track of
- template symbols. HP-UX and Sun CCv4 uses databases for templates
- (by default theses are subdirectories created by the compiler -
- ptrepository and Templates.DB respectively). I've found that HP-UX
- seems to be more tolerant than the Sun implementation and even
- supports templated code in libraries. With g++, you appear to have to
- include source with the header otherwise the linker can't find
- the templated functions. One way round recompiling the templated
- code for each place it is used seems to be to use exemplars.
- In this manner I've managed to keep the templated code in
- a library. In general, my experiences have shown that all of this
- area of C++ compiler behaviour is very hard to predict and consequently
- frustrating to use.
-
-